package com.itheima.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.mapper.CheckGroupItemMapper;
import com.itheima.pojo.CheckGroupItem;
import com.itheima.service.CheckGroupItemService;
import org.apache.dubbo.config.annotation.DubboService;

@DubboService
public class CheckGroupItemServiceImpl extends ServiceImpl<CheckGroupItemMapper, CheckGroupItem> implements CheckGroupItemService {
    @Override
    public Long[] findByGroupId(Long groupId) {
        return this.baseMapper.findByGroupId(groupId);
    }

    @Override
    public boolean deleteByGroupId(Long groupId) {
        QueryWrapper<CheckGroupItem> queryWrapper = new QueryWrapper<>();
        //delete from check_group_item_t where group_id = #{groupId}
        //eq =, gt > ,ge >=, le <=,lt < , like like
        queryWrapper.eq("group_id",groupId);
        return this.remove(queryWrapper);
    }
}
